package cn.com.guage.scala.learn.chapter05

object Test06_HighOrderFunction1 {
  def main(args: Array[String]): Unit = {

    def f(n: Int): Int = {
      println("f调用")
      n + 1
    }
    val result: Int = f(123)
    println(result)

    def operaton(op : (Int,Int) => Int,a:Int,b:Int):Int = {
      op(a,b)
    }
    def add(a:Int,b:Int) = {
      a+b
    }
    println(operaton(add,10,20))

    println(operaton((a: Int, b: Int) => a * b,10,20))

    println((a: Int, b: Int) => a * b,10,20)

  }
}
